package com.fr.data.impl;

import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public abstract class AbstractDatabaseConnection
  implements DatabaseConnection
{
  private String originalCharsetName = null;
  private String newCharsetName = null;

  public String getOriginalCharsetName()
  {
    return this.originalCharsetName;
  }

  public void setOriginalCharsetName(String paramString)
  {
    this.originalCharsetName = paramString;
  }

  public String getNewCharsetName()
  {
    return this.newCharsetName;
  }

  public void setNewCharsetName(String paramString)
  {
    this.newCharsetName = paramString;
  }

  public boolean equals(Object paramObject)
  {
    return ((paramObject instanceof DatabaseConnection) && (ComparatorUtils.equals(getOriginalCharsetName(), ((DatabaseConnection)paramObject).getOriginalCharsetName())) && (ComparatorUtils.equals(getNewCharsetName(), ((DatabaseConnection)paramObject).getNewCharsetName())));
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if ((paramXMLableReader.isChildNode()) && ("DatabaseAttr".equals(paramXMLableReader.getTagName())))
    {
      String str;
      if ((str = paramXMLableReader.getAttr("originalCharsetName")) != null)
        setOriginalCharsetName(str);
      if ((str = paramXMLableReader.getAttr("newCharsetName")) != null)
        setNewCharsetName(str);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("DatabaseAttr");
    if (getOriginalCharsetName() != null)
      paramXMLPrintWriter.attr("originalCharsetName", getOriginalCharsetName());
    if (getNewCharsetName() != null)
      paramXMLPrintWriter.attr("newCharsetName", getNewCharsetName());
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}